<template>
  <div>
    <h3>用户</h3>
    <el-button onclick="alert($)">测试组件引用外部资源脚本</el-button>
    {{
        $store.state.user.msg
    }}
  </div>
</template>

<script>
export default {
  head: {
    script:[
      {src:'http://code.jquery.com/jquery-latest.js'}
    ],
  },
  middleware({ store, route, redirect, params, query, req, res }) {
    //组件独享守卫
    // console.log('middleware nuxt.config outside');
    // redirect('/login')
  },
  data() {
    return {};
  },
  created() {},
  mounted() {},
  methods: {}
};
</script>

<style scoped lang="scss"></style>
